home *** CD-ROM | disk | FTP | other *** search
/ Hackers Handbook - Millenium Edition / Hackers Handbook.iso / library / hack99 / nt_domain_DoS.txt < prev    next >
Encoding:
Internet Message Format  |  1999-03-24  |  11.4 KB

  1. Date: Tue, 2 Mar 1999 16:43:10 -0600
  2. From: Paul L Schmehl <pauls@UTDALLAS.EDU>
  3. To: NTBUGTRAQ@LISTSERV.NTBUGTRAQ.COM
  4. Subject: NT Domain DoS and Security Exploit with SAMBA Server
  5.  
  6. Near the end of November of last year, we notified the SAMBA team,
  7. NTBUGTRAQ and Microsoft of two problems with SAMBA in an NT domain.  The
  8. first was a DoS issue and the second was a logon security issue.
  9.  
  10. Since that time, we have been corresponding with the Microsoft Security
  11. Response Team and doing extensive testing with SAMBA in a test NT
  12. domain.
  13.  
  14. Here's our test network parameters:
  15. NT 4.0 SP4 PDC
  16. NT 4.0 SP4 BDC
  17. RedHat Linux 5.1 with SAMBA 1.9.18p5
  18. Windows NT Workstation client
  19. Windows 98 client
  20.  
  21. Here's the issues:
  22.  
  23. DoS:
  24. *************
  25. When a SAMBA server is placed in a NT domain and configured as follows in
  26. the smb.conf file:
  27.  
  28. security=server
  29. password server=[hostname of PDC]
  30. domain controller=[hostname of PDC]
  31. domain logons=yes
  32.  
  33. domain logons will fail if the PDC is rebooted while the SAMBA server is
  34. still running.  We haven't yet determined *why* this is happening, but
  35. we can tell you *what* is happening.
  36.  
  37. When the SAMBA server comes on line, it does not appear in the WINS
  38. database, but it *does* appear in Server Manager, and reports itself as
  39. a Windows NT 4.2 Server.  After some period of time (which appears to be
  40. random, but less than 24 hours) it begins to report itself as a BDC
  41. (Windows NT 4.2 Backup.)
  42.  
  43. At that point, if the PDC is taken down for any reason, it cannot be
  44. brought up again.  When rebooting the PDC it will report there is
  45. already a PDC in the domain and refuse to complete the boot process, yet
  46. Server Manager reports there is*no* PDC in the domain.  It is impossible to
  47. "promote" or "demote" the PDC or to bring it back on line any other way.
  48. At this point, domain logons will begin failing, and the domain essentially
  49. becomes unusable.  The only solution is to kill the SAMBA server, at which
  50. point the PDC will finish booting and the domain will return to normal.
  51.  
  52. The SAMBA team claims to have avoided this problem in 2.0 according to
  53. Jeremy Allison:
  54.  
  55.         "This very problem is why my new code in 2.0 explicitly forces
  56. the Samba admin to give the name or IP address of the PDC to authenticate
  57. to, and to allow the name resolution to be forced to
  58. look only in the local hosts file on that machine."
  59.  
  60. However, we are presently experiencing this problem on our "real" domain
  61. with what appears to be a SAMBA 2.0 server (At least it reports itself as
  62. that in Server Manager.)  I say "appears to be", because we just found the
  63. suspect server today, and I can't confirm all the details of its
  64. configuration at this time.  It definitely disrupted domain logons and
  65. prevented the PDC from rebooting.  (We had one processor suffering from
  66. heat related failure and had to shut down the PDC last Friday to replace a
  67. defective fan.)
  68.  
  69. Microsoft's Security Response team has looked at this issue and
  70. determined that it cannot be addressed in NT 4.0 due to the insecure nature
  71. of WINS and NTLM.  They claim it will be fixed in Windows 2000:
  72.  
  73.         "In Windows 2000, DC are located using DNS lookups with
  74. authenticated DNS updates of service location information, so we believe
  75. that homogeneous Windows 2000 networks will not be susceptible to this
  76. problem."
  77.  
  78. Security:
  79. **************
  80. We all know Windows 95/98 is inherently insecure.  With a SAMBA server
  81. configured as above, it is possible to effect logons on the SAMBA
  82. server.  During our troubleshooting, we noticed that machines all over
  83. campus were being logged on by the SAMBA server, which would query a "real"
  84. DC for the auth and then pass the auth to the client.  This opens an
  85. obvious avenue of attack.
  86.  
  87. We copied the files from the NETLOGON share on a BDC to the newly
  88. created NETLOGON share on the SAMBA server.  We then wrote a program
  89. spoofing the Windows Logon screen, popped up an error message that
  90. essentially said "your logon had failed, please reenter your
  91. username/password" and were able to get users to enter their
  92. username/password combo into our program, which wrote them to a text file
  93. on the SAMBA server.  (NT Workstations are unaffected by the SAMBA logon
  94. since they won't authenticate without an exchange of tokens.)
  95.  
  96. The workaround for this security hole, according to Microsoft is:
  97.  
  98. "1. Locating Valid Logon DCs:
  99.  
  100.                 The workaround here is to use LMHOSTS to point clients
  101. to logon DCs.  There are two Knowledge Base articles, at
  102. http://support.microsoft.com/support/kb/articles/q192/0/64.asp and
  103. http://support.microsoft.com/support/kb/articles/q150/8/00.asp, that
  104. provide info on how to do this.  This is not a complete fix, because the
  105. attacker can still spoof the servers at the IP layer (respond to ARP for
  106. the servers' IP addresses). However, it does mean that any spoofing that is
  107. done must be done at the IP layer, which is harder.
  108.  
  109. 2. Locating Valid Logon Script Shares:
  110.  
  111.                 With Windows NT 4.0 SP3 and Win9x, it is possible to
  112. configure clients to require SMB packet signing.  Once this is done,
  113. only members of some trusted domain can spoof the NETLOGON shares. It also
  114. means that clients will refuse to access shares on servers that don't
  115. support SMB signing, which is any server earlier than NT4/SP3: Win9x
  116. servers or NT3.x servers or Samba servers, for example.  Alternatively, you
  117. could configure LMHOSTS entries on clients for servers that provide logon
  118. script shares.  This is a less effective workaround than SMB signing, but
  119. would allow clients to use downlevel SMB servers."
  120.  
  121. Our testing has confirmed that this workaround will prevent Win95/98
  122. clients from logging in to the domain through a SAMBA server.
  123.  
  124. We are still in contact with Microsoft on these issues, and if anything
  125. of note transpires we will notify the list again.
  126.  
  127. --------------------------------------------------------------------------------
  128.  
  129. Date: Tue, 2 Mar 1999 22:42:15 -0600
  130. From: Gerald Carter <cartegw@Eng.Auburn.EDU>
  131. Reply-To: jerry@Eng.Auburn.EDU
  132. To: NTBUGTRAQ@LISTSERV.NTBUGTRAQ.COM
  133. Subject: Re: NT Domain DoS and Security Exploit with SAMBA Server
  134.  
  135. Paul L Schmehl wrote:
  136. >
  137. > security=server
  138. > password server=[hostname of PDC]
  139. > domain controller=[hostname of PDC]
  140.  
  141. This is a boolean parameter in the current code (and obselete
  142. I might add)
  143.  
  144. > domain logons=yes
  145. >
  146. > domain logons will fail if the PDC is rebooted while the
  147. > SAMBA server is still running.  We haven't yet determined
  148. > *why* this is happening, but we can tell you *what* is
  149. > happening
  150.  
  151. If you set the workgroup to be the same as the domain of
  152. the NT PDC you are referring to, Samba will attempt to
  153. register the workgroup<1b> record (due to domain logons being
  154. enabled). Windows clients use this to locate the DC for their
  155. workgroup
  156.  
  157. > database, but it *does* appear in Server Manager, and
  158. > reports itself as a Windows NT 4.2 Server.  After some period
  159. > of time (which appears to be random, but less than 24 hours)
  160. > it begins to report itself as a BDC (Windows NT 4.2 Backup.)
  161.  
  162. The annouce as in Samba 2.0.3 allows you to advertise as a
  163. workstation although the default is still to advertise as a
  164. Server.
  165.  
  166. The moral is to not enable domain logons if you have an
  167. existing DC.  You don't try to run to PDC's concurrently.
  168. Same here
  169.  
  170. > Microsoft's Security Response team has looked at this
  171. > issue and determined that it cannot be addressed in NT 4.0
  172. > due to the insecure nature of WINS and NTLM.
  173.  
  174. correct.  The problem is the dynamic nature in which NetBIOS
  175. names are registered and released.  It is insecure.
  176.  
  177. > We then wrote a program spoofing the Windows Logon
  178. > screen, popped up an error message that essentially said
  179. > "your logon had failed, please reenter your username/password"
  180. > and were able to get users to enter their username/password
  181. > combo into our program, which wrote them to a text file
  182. > on the SAMBA server.
  183.  
  184. Don't get this.  So you wrote a mimic program. Not sure how
  185. this relates.  Could do this without Samba.
  186.  
  187. Again, just to clarify,
  188.  
  189. * why are you trying to bring up to DC's (Samba and NT)?
  190.  
  191. * Assuming that you a meaning that anyone on the network
  192.   can do this, I agree it can disrupt service, but is not
  193.   specific to Samba.  Imagine this scenario,
  194.  
  195.     - I install a Windows NT Server as a PDC off the
  196.       network in your domain.
  197.     - Then I connect it to the network.
  198.     - it will also attempt to take over, right?
  199.  
  200. What's the difference?  The problem appears to be
  201. netbios name resolutions and regostration and not
  202. Samba.  Aplogies if I misunderstood you post.
  203.  
  204.  
  205.  
  206.  
  207. Comments and corrections always welcome.
  208. jerry carter
  209. ________________________________________________________________________
  210.                             Gerald ( Jerry ) Carter
  211. Engineering Network Services                           Auburn University
  212. jerry@eng.auburn.edu             http://www.eng.auburn.edu/users/cartegw
  213.  
  214.        "...a hundred billion castaways looking for a home."
  215.                                   - Sting "Message in a Bottle" ( 1979 )
  216.  
  217. --------------------------------------------------------------------------------
  218.  
  219. Date: Wed, 3 Mar 1999 10:18:08 -0600
  220. From: Paul L Schmehl <pauls@UTDALLAS.EDU>
  221. To: NTBUGTRAQ@LISTSERV.NTBUGTRAQ.COM
  222. Subject: Re: NT Domain DoS and Security Exploit with SAMBA Server
  223.  
  224. Comments below.
  225.  
  226. --On Tuesday, March 02, 1999, 10:42 PM -0600 Gerald Carter
  227. <cartegw@eng.auburn.edu> wrote:
  228.  
  229. [snip]
  230. >
  231. > The moral is to not enable domain logons if you have an
  232. > existing DC.  You don't try to run to PDC's concurrently.
  233. > Same here
  234.  
  235. Of course.  The problem is SAMBA doesn't exchange tokens with the other DCs
  236. before becoming a member of the Domain Server Group.  This isn't SAMBA's
  237. fault, it's Microsoft's, for not having a secure method to register DCs.
  238.  
  239. Also, domain logons=yes is the default setting in the smb.conf file, so
  240. this can be done completely without the knowledge of the individual setting
  241. up SAMBA.  This is apparently still true in SAMBA 2.0, because the server I
  242. mentioned in my post took down the domain without the knowledge of the
  243. admin who set it up.
  244. >
  245. [snip]
  246. >
  247. > Don't get this.  So you wrote a mimic program. Not sure how
  248. > this relates.  Could do this without Samba.
  249.  
  250. How?  You have to have something which is seen by clients as a DC with a
  251. NETLOGON share before you can start processing logons.  You can't do that
  252. with an NT server without knowing the domain administrator password.  You
  253. can do it with SAMBA without any authentication at all.
  254. >
  255. > Again, just to clarify,
  256. >
  257. > * why are you trying to bring up to DC's (Samba and NT)?
  258.  
  259. We're not.  They do that be default.  And that's my point.  *Anyone* in
  260. your organization can bring up a SAMBA server and take down the domain
  261. (under the right circumstances as posted.)  This has already happened to us
  262. twice, both times without the knowledge or approval of the IR department.
  263.  
  264. [snip]
  265. >
  266. > What's the difference?  The problem appears to be
  267. > netbios name resolutions and regostration and not
  268. > Samba.  Aplogies if I misunderstood you post.
  269.  
  270. I'm not blaming SAMBA.  This is obviously a flaw in the fundamental design
  271. of domain security, and Microsoft has acknowledged that.  The only point of
  272. SAMBA being involved is it makes the task much easier because there's no
  273. authentication and token exchange required.
  274. >
  275. >
  276. >
  277. >
  278. > Comments and corrections always welcome.
  279. > jerry carter
  280. > ________________________________________________________________________
  281. >                             Gerald ( Jerry ) Carter
  282. > Engineering Network Services                           Auburn University
  283. > jerry@eng.auburn.edu             http://www.eng.auburn.edu/users/cartegw
  284. >
  285. >        "...a hundred billion castaways looking for a home."
  286. >                                   - Sting "Message in a Bottle" ( 1979 )
  287.  
  288.